package com.lbs.jiepiaisi.view;

import android.content.Context;

import com.lbs.jiepiaisi.R;

/**
 *
 * 时间：2017/6/16 13:14
 * 作用：等待进度框控制器
 */

public class WaitingDialogControll {
    /**
     * 等待进度框
     */
    private static LoadingDialog customDialog;
    /**
     * 显示等待对话框
     */
    public static void showWaitingDialog(Context context) {
        if (customDialog == null) {
            customDialog = new LoadingDialog(context,R.style.LoadingDialog);
            try {
                customDialog.show();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    /**
     * 隐藏等待对话框
     */
    public static void dismissWaitingDialog() {
        if (customDialog != null) {
            try {
                customDialog.dismiss();
                customDialog = null;
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
